<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('我的预约')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								教练名：<input type="text" name="coachName"/>
							</li>

							<li>
								教练手机号：<input type="text" name="coachPhone"/>
							</li>

							<li>
								学员名：<input type="text" name="userName"/>
							</li>

							<!-- <li>
								开始时间：<input type="text" name="statrtTime"/>
							</li>

							<li>
								结束时间：<input type="text" name="endTime"/>
							</li> -->

							<li>
								状态：<!-- <input type="text" name="status"/> -->
								<select name="status" th:with="type=${@dict.getType('sys_reservation_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:reservation:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:reservation:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:reservation:remove">
					<i class="fa fa-remove"></i> 删除
				</a> -->
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:reservation:export">
						<i class="fa fa-download"></i> 导出
				 </a>
				 <a class="btn btn-primary btn-edit disabled" onclick="$.operate.reservationcancel()" shiro:hasPermission="system:reservation:edit">
					<i class="fa fa-edit"></i> 取消预约
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:reservation:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:reservation:remove')}]];
        var prefix = ctx + "system/reservation";
        var datas = [[${@dict.getType('sys_reservation_status')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                cancelUrl: prefix + "/edit",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "预约记录",
		        showExport: false,
		        clickToSelect: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'reservationId', 
					title : '预约记录id',
					visible: false
				},
				/* {
					field : 'coachId', 
					title : '教练id',
					sortable: true
				}, */
				{
					field : 'coachName', 
					title : '教练名',
					sortable: true
				},
				/* {
					field : 'coachPhone', 
					title : '教练手机号',
					sortable: true
				}, */
				/* {
					field : 'userId', 
					title : '用户id',
					sortable: true
				}, */
				{
					field : 'userName', 
					title : '用户名',
					sortable: true
				},
				{
					field : 'statrtTime', 
					title : '开始时间',
					sortable: true
				},
				{
					field : 'endTime', 
					title : '结束时间',
					sortable: true
				},
				{
					field : 'status', 
					title : '状态',
					sortable: true,
					align: "left",
					formatter: function(value, row, index) {
					    return $.table.selectDictLabel(datas, value);
					}
				},
				/* {
					field : 'isDisable', 
					title : '是否显示',
					sortable: true
				},
				{
					field : 'createBy', 
					title : '创建者',
					sortable: true
				}, */
				{
					field : 'createTime', 
					title : '创建时间',
					sortable: true
				},
				/* {
					field : 'updateBy', 
					title : '更新者',
					sortable: true
				},
				{
					field : 'updateTime', 
					title : '更新时间',
					sortable: true
				}, */
				{
					field : 'subject', 
					title : '科目',
					sortable: true
				},
				{
					field : 'drivingLicenseType', 
					title : '驾照类型',
					sortable: true
				},
				{
					field : 'remark', 
					title : '备注',
					sortable: true
				},
				
		        /* {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.reservationId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.reservationId + '\')"><i class="fa fa-remove"></i>删除</a>');
						
						return actions.join('');
		            }
		        } */]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>